package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.CodeUtils;

/**
 * <p>
 * ${table.comment!} 服务实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Service
@RequiredArgsConstructor
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {

}
<#else>
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {

    private static final String CODE_KEY = "${entity?uncap_first}:";
    private final RedisCache redisCache;

   @Override
   public List<${entity}> selectList(${entity} ${entity?uncap_first}) {
        LambdaQueryWrapper<${entity}> wrapper = new LambdaQueryWrapper<>();
        return this.list(wrapper);
   }

    @Override
    public String generateCode() {
        return CodeUtils.generateCodeWithService(
            CODE_KEY,
            ${table.serviceName}.class,
            this,
            redisCache
        );
    }


}
</#if>
